package com.dmgis.hndz.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dmgis.hndz.pojo.Ybba02c;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author PC
* @description 针对表【ybba02c(市级预警临时表)】的数据库操作Mapper
* @createDate 2024-01-29 17:47:43
* @Entity com.dmgis.hndz.pojo.Ybba02c
*/
@Mapper
public interface Ybba02cMapper extends BaseMapper<Ybba02c> {

// 假设定义了以下常量：

    @Insert("INSERT INTO ybba02c (ybba02c010, ybba02c020, ybba02c030, ybba02c040, ybba02c050, ybba02c060, ybba02c070" +
            ", ybba02c080, ybba02c090, ybba02c100, ybba02c110, ybba02c120" +
            ") VALUES (#{ybba02c010}, #{ybba02c020}, #{ybba02c030}, #{ybba02c040}, #{ybba02c050}, #{ybba02c060}, #{ybba02c070}" +
            ", #{ybba02c080}, #{ybba02c090}, #{ybba02c100}, #{ybba02c110}, #{ybba02c120})")
    int insert(Ybba02c ybba02c);

    @Select("select * from ybba02c" +
            "where ybba02c090 = '${advcode}' " +
            "and ybba02c030 between #{startTime} and #{endTime}")
    List<Ybba02c> getProduct(String advcode, String startTime, String endTime);

    @Select("select * from ybba02c where ybba02c090 = '${advcode}' order by ybba02c030 desc limit 1")
    Ybba02c getProductone(String advcode);
}




